<script src="/assets/js/echarts.min.js"></script>
<?php
use yii\helpers\Url;
?>
<h4 style="text-align: center">居民积分详情</h4>


<div id="main" style="width:100%;height: 15rem"></div>
<script type="text/javascript">
    // 基于准备好的dom，初始化echarts实例
    var myChart = echarts.init(document.getElementById('main'));

    myChart.setOption({
        series : [
            {
                name: '访问来源',
                type: 'pie',
                radius: '55%',
                data:[
                    {value:<?=$user->green?>, name:'绿积分'},
                    {value:<?=$user->blue?>, name:'蓝积分'},
                    {value:<?=$green?$green:0?>, name:'已兑换绿积分'},
                    {value:<?=$blue?$blue:0?>, name:'已兑换蓝积分'}

                ]
            }
        ]
    })
</script>
<div style="text-align: center"><a href="<?=Url::to(['customer/log'])?>" class="weui-btn weui-btn_mini weui-btn_primary">查看详情</a></div>
<h4 style="text-align: center">环保贡献值</h4>
<div class="weui-flex" style="text-align: center;margin-top: 1rem">

    <div class="weui-flex__item"><img style="width: 40%" src="/assets/img/page.png"></div>
    <div class="weui-flex__item"><img style="width: 40%" src="/assets/img/tree.png"></div>
    <div class="weui-flex__item"><img style="width: 40%" src="/assets/img/cloud.png"></div>
</div>
<div class="weui-flex" style="text-align: center">

    <div class="weui-flex__item">纸类回收<br/>50kg</div>
    <div class="weui-flex__item">拯救树木<br/>100颗</div>
    <div class="weui-flex__item">减少碳排放<br/>10000立方米</div>
</div>


